package com.xtm.exercise.utils.easyexcel.model;

import java.util.ArrayList;
import java.util.List;

public class EasyExcelImportResult {
    private Integer rowNum;
    private Integer totalNum = 0;
    private Integer successNum = 0;
    private String errorMessage;
    private Boolean importSuccess = true;
    private List<EasyExcelImportResult> failedList;

    public Integer getRowNum() {
        return rowNum;
    }

    public void setRowNum(Integer rowNum) {
        this.rowNum = rowNum;
    }

    public Integer getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    public Integer getSuccessNum() {
        return successNum;
    }

    public void setSuccessNum(Integer successNum) {
        this.successNum = successNum;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public List<EasyExcelImportResult> getFailedList() {
        return failedList;
    }

    public void setFailedList(List<EasyExcelImportResult> failedList) {
        this.failedList = failedList;
    }

    public Boolean getImportSuccess() {
        return importSuccess;
    }

    public void setImportSuccess(Boolean importSuccess) {
        this.importSuccess = importSuccess;
    }

    public void addFailedImport(EasyExcelImportResult failedImport){
        if(this.failedList == null){
            this.failedList = new ArrayList<>();
        }

        failedList.add(failedImport);
    }
}
